/*
 * HtmlComparisonDataTableTag.java
 *
 * Created on 2007.06.20, 23:18:07
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package hr.ctg.component.tag;

import javax.el.ExpressionFactory;
import javax.el.ValueExpression;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.webapp.UIComponentELTag;

/**
 * 
 * @author Administrator
 */
public class HtmlComparisonDataTableTag extends UIComponentELTag {

	String objekti;
	String osobine;
	String tableHeader;
	String tableFooter;
	String headerStyle;
	String headerStyleClass;
	String footerStyle;
	String footerStyleClass;
	String tableHeaderStyle;
	String tableHeaderStyleClass;
	String tableFooterStyle;
	String tableFooterStyleClass;
	String leadingColumnStyle;
	String leadingColumnStyleClass;
	String rowStyleClasses;
	String column;

	public HtmlComparisonDataTableTag() {
	}

	@Override
	public String getComponentType() {
		return "HtmlComparisonDataTable";
	}

	@Override
	public String getRendererType() {
		return null;
	}

	@Override
	protected void setProperties(UIComponent component) {
		super.setProperties(component);
		final ExpressionFactory ef = FacesContext.getCurrentInstance()
				.getApplication().getExpressionFactory();
		if (objekti != null) {
			ValueExpression vb = ef
					.createValueExpression(objekti, String.class);
			component.setValueExpression(objekti, vb);
		}
		if (osobine != null) {
			ValueExpression vb = ef
					.createValueExpression(osobine, String.class);
			component.setValueExpression("osobine", vb);
		}
		if (column != null) {
			System.out.println("column...");
			ValueExpression vb = ef.createValueExpression(column, String.class);
			component.setValueExpression("column", vb);
		}
		if (headerStyle != null) {
			System.out.println("headerStyle nije null...");
			ValueExpression ve = ef.createValueExpression(headerStyle,
					String.class);
			component.setValueExpression("headerStyle", ve);
		}
		if (headerStyleClass != null) {
			System.out.println("headerStyle nije null...");
			ValueExpression ve = ef.createValueExpression(headerStyleClass,
					String.class);
			component.setValueExpression("headerStyleClass", ve);
		}
		if (tableHeader != null) {
			System.out.println("tableHeader...");
			ValueExpression ve = ef.createValueExpression(tableHeader,
					String.class);
			component.setValueExpression("tableHeader", ve);
		}
		if (tableFooter != null) {
			System.out.println("tableFooter...");
			ValueExpression ve = ef.createValueExpression(tableFooter,
					String.class);
			component.setValueExpression("tableFooter", ve);
		}

	}

	@Override
	public void release() {
		super.release();
		osobine = null;
		objekti = null;
	}

	public void setObjekti(String objekti) {
		this.objekti = objekti;
	}

	public void setOsobine(String osobine) {
		this.osobine = osobine;
	}

	public void setHeaderStyle(String headerStyle) {
		this.headerStyle = headerStyle;
	}

	public void setHeaderStyleClass(String headerStyleClass) {
		this.headerStyleClass = headerStyleClass;
	}

	public void setFooterStyle(String footerStyle) {
		this.footerStyle = footerStyle;
	}

	public void setFooterStyleClass(String footerStyleClass) {
		this.footerStyleClass = footerStyleClass;
	}

	public void setTableHeaderStyle(String tableHeaderStyle) {
		this.tableHeaderStyle = tableHeaderStyle;
	}

	public void setTableHeaderStyleClass(String tableHeaderStyleClass) {
		this.tableHeaderStyleClass = tableHeaderStyleClass;
	}

	public void setTableFooterStyle(String tableFooterStyle) {
		this.tableFooterStyle = tableFooterStyle;
	}

	public void setTableFooterStyleClass(String tableFooterStyleClass) {
		this.tableFooterStyleClass = tableFooterStyleClass;
	}

	public void setLeadingColumnStyle(String leadingColumnStyle) {
		this.leadingColumnStyle = leadingColumnStyle;
	}

	public void setLeadingColumnStyleClass(String leadingColumnStyleClass) {
		this.leadingColumnStyleClass = leadingColumnStyleClass;
	}

	public void setRowStyleClasses(String rowStyleClasses) {
		this.rowStyleClasses = rowStyleClasses;
	}

	public void setTableHeader(String tableHeader) {
		this.tableHeader = tableHeader;
	}

	public void setTableFooter(String tableFooter) {
		this.tableFooter = tableFooter;
	}

	public void setColumn(String column) {
		this.column = column;
	}

}
